ostree.git
12 years agoadmin: Silence a gcc warning
Colin Walters [Thu, 12 Sep 2013 18:34:38 +0000 (14:34 -0400)]
admin: Silence a gcc warning

It can't happen, but anyways.

12 years agoCOPYING: Now fully LGPLv2+
Colin Walters [Wed, 11 Sep 2013 23:55:24 +0000 (19:55 -0400)]
COPYING: Now fully LGPLv2+

I ran into Jeremy Katz today, and he gave me permission to relicense
the small bits of switch-root.c to LGPLv2+.  This combined with
permission from Peter Jones allows OSTree to become fully LGPLv2+.

Not a big deal, it's just a lot clearer to only have one license, and
it makes it easier to turn application code into library code.

12 years agocheckout: Fix previous commit
Colin Walters [Wed, 11 Sep 2013 15:54:53 +0000 (11:54 -0400)]
checkout: Fix previous commit

Don't try to close in cases where we don't have input.

12 years agocheckout: Fix file descriptor leak for copying checkouts
Colin Walters [Wed, 11 Sep 2013 14:58:22 +0000 (10:58 -0400)]
checkout: Fix file descriptor leak for copying checkouts

Hardlink checkouts didn't hit this, but we need to close the input
stream.

12 years agoUpdate libgsystem
Colin Walters [Wed, 11 Sep 2013 12:28:09 +0000 (08:28 -0400)]
Update libgsystem

And while we're here, also update the TODO slightly.

12 years agolibostree: Fix compiler warning
Colin Walters [Tue, 10 Sep 2013 16:25:13 +0000 (12:25 -0400)]
libostree: Fix compiler warning

12 years agocheckout: Add g_prefix_error() around more failures
Colin Walters [Tue, 10 Sep 2013 15:53:40 +0000 (11:53 -0400)]
checkout: Add g_prefix_error() around more failures

So we can debug what's going wrong more easily.

12 years agorepo: Make the optimization for reusing checksums clearer
Jasper St. Pierre [Sun, 8 Sep 2013 16:43:21 +0000 (12:43 -0400)]
repo: Make the optimization for reusing checksums clearer

The code here is a bit hard to understand, so make it clearer by cleaning
up the flow control and adding some comments.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo: Make read_commit spit out a resolved commit ref as well
Jasper St. Pierre [Sat, 7 Sep 2013 18:21:24 +0000 (14:21 -0400)]
repo: Make read_commit spit out a resolved commit ref as well

read_commit resolves the ref to a commit, and a lot of consumers want
the resolved commit for their own purposes; this prevents them from
calling resolve_rev themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo-libarchive: Apply commit modifiers to libarchive archives as well
Jasper St. Pierre [Sat, 7 Sep 2013 04:42:25 +0000 (00:42 -0400)]
repo-libarchive: Apply commit modifiers to libarchive archives as well

And document the libarchive methods as well, so we can pass a NULL
commit modifier.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo: Change the pairs of checksums to instead be based on OstreeRepoFiles
Jasper St. Pierre [Sat, 7 Sep 2013 00:17:44 +0000 (20:17 -0400)]
repo: Change the pairs of checksums to instead be based on OstreeRepoFiles

We want an OstreeRepoFile to be the way to reference a "filesystem
tree" that's stored in the repo, which is a combination of a DIR_TREE
and a DIR_META. The idea is that once you write an mtree to the repo
using ostree_repo_write_mtree, it becomes serialized and you get an
OstreeRepoFile in return.

Change any APIs that care about DIR_TREE / DIR_META checksums to care
about OstreeRepoFiles instead, which right now is mostly is
ostree_repo_write_commit.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo-file: Base OstreeRepoFile on trees instead of commits
Jasper St. Pierre [Sat, 7 Sep 2013 03:27:45 +0000 (23:27 -0400)]
repo-file: Base OstreeRepoFile on trees instead of commits

We want an OstreeRepoFile to be the way to represent a filesystem tree
inside an ostree repository. In order to do this, we need to drop the
commit from an OstreeRepoFile, and make that go to callers.

Switch all current users of ostree_repo_file_new_root to
ostree_repo_read_commit, and make the actual constructor private.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agocore: Add detached metadata, readd metadata to commits
Colin Walters [Mon, 9 Sep 2013 21:01:32 +0000 (17:01 -0400)]
core: Add detached metadata, readd metadata to commits

Previously I thought we'd have to ditch the current commit
format to avoid a{sv} due to

See https://bugzilla.gnome.org/show_bug.cgi?id=673012

But I realized that we don't really have to care about
unpacking/repacking commit objects, so let's just re-expose the
existing metadata a{sv} in commits in the API.

Also, add support for "detached" metadata that can be updated at any
time post-commit.  This is specifically designed for GPG signatures.

https://bugzilla.gnome.org/show_bug.cgi?id=707379

12 years agoUpdate libgsystem
Colin Walters [Mon, 9 Sep 2013 20:06:51 +0000 (16:06 -0400)]
Update libgsystem

Now with new shiny implementation of gs_shutil_rm_rf().

12 years agopull: ref the thread default main context during init, unref in cleanup
Vivek Dasmohapatra [Mon, 9 Sep 2013 14:54:26 +0000 (15:54 +0100)]
pull: ref the thread default main context during init, unref in cleanup

...get_thread_default returns NULL when the thread default is also the global
default, so this only shows up when running in a thread (eg g_task_run_in_thread)

12 years agocore: Use openat() for reading bare file objects too
Colin Walters [Sun, 8 Sep 2013 23:31:44 +0000 (19:31 -0400)]
core: Use openat() for reading bare file objects too

...unless we want xattrs, in which case we have to fallback to path
lookup due to lack of llistxattrat().

This looks nicer in strace.

12 years agocore: Delete unused OstreeRepoFile API
Colin Walters [Sun, 8 Sep 2013 20:49:21 +0000 (16:49 -0400)]
core: Delete unused OstreeRepoFile API

Was just unused, and it was using further API i want to remove.

12 years agorepo: Delete leftover repo/pending dir
Colin Walters [Sun, 8 Sep 2013 19:04:35 +0000 (15:04 -0400)]
repo: Delete leftover repo/pending dir

This is a relic from long ago when we were trying to stage objects
before finally committing them all in one go in the pull code.

We're no longer doing that, so stop trying to make the directory.
This also fixes trying to use ostree as non-root to read the
root-owned repo, since we'd fail to create the pending dir.

12 years agocore: Use at-relative functions for checking out tree copies too
Colin Walters [Sun, 8 Sep 2013 14:35:47 +0000 (10:35 -0400)]
core: Use at-relative functions for checking out tree copies too

For the cases where we can't hardlink, use at-relative walking of the
path where possible.  We still don't have lsetxattrat, so we also need
to deal with pathnames, but that is now only for symlinks.

Again, the advantages of this are a lot less malloc() of pathnames in
ostree, and much less time spent traversing paths inside the kernel.

https://bugzilla.gnome.org/show_bug.cgi?id=707733

12 years agocore: Make ostree_set_xattrs() private
Colin Walters [Sun, 8 Sep 2013 01:56:36 +0000 (21:56 -0400)]
core: Make ostree_set_xattrs() private

Nothing external uses it.  We keep ostree_get_xattrs_for_file() public
because it's convenient for external consumers to get xattrs in
exactly the format we desire.

https://bugzilla.gnome.org/show_bug.cgi?id=707733

12 years agocore: Make write_object() a bit more efficient
Colin Walters [Sun, 8 Sep 2013 01:49:56 +0000 (21:49 -0400)]
core: Make write_object() a bit more efficient

Do as many operations as we can using the original file descriptor
while we have it open, rather than writing, closing, then reopening.

This necessitated very explicitly special casing symbolic links,
mainly due to the lack of lsetxattrat().

https://bugzilla.gnome.org/show_bug.cgi?id=707733

12 years agocore: Use linkat() for hardlink checkouts too
Colin Walters [Sat, 7 Sep 2013 23:01:27 +0000 (19:01 -0400)]
core: Use linkat() for hardlink checkouts too

Clean up how we deal with the uncompressed object cache; we now use
openat()/linkat() and such just like we do for the main objects/.

Use linkat() between the objects and the destination, if possible.

https://bugzilla.gnome.org/show_bug.cgi?id=707733

12 years agorepo: Make the body parameter to ostree_repo_commit optional
Jasper St. Pierre [Sat, 7 Sep 2013 00:09:59 +0000 (20:09 -0400)]
repo: Make the body parameter to ostree_repo_commit optional

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo: Drop the branch parameter from ostree_repo_commit
Jasper St. Pierre [Sat, 7 Sep 2013 00:09:44 +0000 (20:09 -0400)]
repo: Drop the branch parameter from ostree_repo_commit

It's unused. Make users explicitly write a ref if they want this;
high-level convenience API will be introduced later.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agobuiltin-commit: Don't parse the parent's GVariant by hand
Jasper St. Pierre [Fri, 6 Sep 2013 23:35:23 +0000 (19:35 -0400)]
builtin-commit: Don't parse the parent's GVariant by hand

Instead, use OstreeRepoFile as a handle for the parent commit.
We need to add an accessor for the metadata checksum, as that
hasn't been exposed before.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo-file: s/content_checksum/contents_checksum/
Jasper St. Pierre [Sat, 7 Sep 2013 00:19:42 +0000 (20:19 -0400)]
repo-file: s/content_checksum/contents_checksum/

This is what we call it everywhere else, so just be consistent.
It also lines up with metadata_checksum better.

https://bugzilla.gnome.org/show_bug.cgi?id=707727

12 years agorepo: Fix file descriptor leak from previous commit
Colin Walters [Sun, 8 Sep 2013 14:41:18 +0000 (10:41 -0400)]
repo: Fix file descriptor leak from previous commit

I keep forgetting mmap doesn't take ownership of the fd.

12 years agocore: Use at-relative lookups for archive-z2 content
Colin Walters [Sat, 7 Sep 2013 14:10:21 +0000 (10:10 -0400)]
core: Use at-relative lookups for archive-z2 content

We can't quite do it for bare repositories yet because we need to have
a way to go from struct stat -> GFileInfo, and that's buried in gio's
private GLocalFile class.

12 years agocore: Use at-relative lookups for metadata reading
Colin Walters [Sat, 7 Sep 2013 09:01:41 +0000 (05:01 -0400)]
core: Use at-relative lookups for metadata reading

Just use openat() for locating variants, rather than doing the lstat()
+ open().  This also drops several malloc+object allocations from the
lookup path.

12 years agocore: Use at-relative lookup for locating objects too
Colin Walters [Sat, 7 Sep 2013 08:47:40 +0000 (04:47 -0400)]
core: Use at-relative lookup for locating objects too

Add new internal API to both fstatat() and write a pathname for the
given object.  Use it in commit, and also wrapped in the old
GFile-based API.

This is more efficient.

12 years agocore: Add malloc-free API for objects, use *at functions for storing
Colin Walters [Sat, 7 Sep 2013 00:33:55 +0000 (20:33 -0400)]
core: Add malloc-free API for objects, use *at functions for storing

This is more efficient; we avoid malloc of a number of pathname +
GFile objects, plus the kernel doesn't have to traverse the repo path
again.

12 years agorepo: Make commit_transaction introspectable
Jasper St. Pierre [Sat, 7 Sep 2013 05:37:09 +0000 (01:37 -0400)]
repo: Make commit_transaction introspectable

12 years agoFix build
Jasper St. Pierre [Sat, 7 Sep 2013 00:47:13 +0000 (20:47 -0400)]
Fix build

Before I pushed the "move code to a different file" commit, I rebased,
but forgot to test the build. Sorry.

12 years agoMove ref writing to be transaction-based
Jasper St. Pierre [Thu, 5 Sep 2013 21:25:26 +0000 (17:25 -0400)]
Move ref writing to be transaction-based

Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Move the scanning hardlinks optimization out of prepare_transaction
Jasper St. Pierre [Fri, 6 Sep 2013 22:51:54 +0000 (18:51 -0400)]
repo: Move the scanning hardlinks optimization out of prepare_transaction

This is just a terrible API to have. Make the scanning a separate method,
and document it as an optimization.

12 years agorepo: Make abort_transaction silently succeed if we're not in a transaction
Jasper St. Pierre [Thu, 5 Sep 2013 21:57:53 +0000 (17:57 -0400)]
repo: Make abort_transaction silently succeed if we're not in a transaction

This helps callers out a lot, and means we can always call abort_transaction
at the end of a function.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Move the transaction stats to a separate struct
Jasper St. Pierre [Thu, 5 Sep 2013 20:48:40 +0000 (16:48 -0400)]
repo: Move the transaction stats to a separate struct

This is much easier for callers to handle, and simplifies
the API a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Rename "stage" to "write" in the API
Jasper St. Pierre [Thu, 5 Sep 2013 20:36:44 +0000 (16:36 -0400)]
repo: Rename "stage" to "write" in the API

An earlier version of this API acted like git in that some objects
would be staged in a temporary directory which would be then committed
in one go by moving files around. The API doesn't match most users
expectations though, as while the stage is nice as a high-level API
it isn't really suited for low-level APIs.

While the stage was removed, the APIs were never renamed. Rename
them now so that they match expectations.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Move commit code to another file
Jasper St. Pierre [Thu, 5 Sep 2013 19:43:07 +0000 (15:43 -0400)]
repo: Move commit code to another file

ostree-repo.c is a bit too big, and most of the commit code is
fairly standalone.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Make prepare_transaction introspectable
Jasper St. Pierre [Thu, 5 Sep 2013 19:30:25 +0000 (15:30 -0400)]
repo: Make prepare_transaction introspectable

We need to document the out pointer as an out pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Make OSTreeCommitModifier introspectable
Jasper St. Pierre [Thu, 5 Sep 2013 19:10:54 +0000 (15:10 -0400)]
repo: Make OSTreeCommitModifier introspectable

Callbacks need GDestroyNotifies to be usable from bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agorepo: Make the ordering consistent between abort/complete_transaction
Jasper St. Pierre [Thu, 5 Sep 2013 19:30:15 +0000 (15:30 -0400)]
repo: Make the ordering consistent between abort/complete_transaction

This just makes the functions nicer to stare at.

https://bugzilla.gnome.org/show_bug.cgi?id=707644

12 years agocore: When using hardlinks, always use linkat() for destination
Colin Walters [Fri, 6 Sep 2013 22:28:20 +0000 (18:28 -0400)]
core: When using hardlinks, always use linkat() for destination

This avoids repeatedly traversing the target pathname, and is just
more efficient.

Part of a prelude to using fd-relative API for the source object path
too.

12 years agocore: Use fd-relative creation for tmp/
Colin Walters [Fri, 6 Sep 2013 22:19:54 +0000 (18:19 -0400)]
core: Use fd-relative creation for tmp/

Update libgsystem submodule for a bugfix.

This is both more efficient from a kernel perspective, and avoids us
calling gs_file_get_path_cached() on tmp_dir constantly, which
triggered another bug due to lack of locking.

12 years agoUpdate .gitignore
Jasper St. Pierre [Thu, 5 Sep 2013 22:18:51 +0000 (18:18 -0400)]
Update .gitignore

12 years agoUpdate docs
Jasper St. Pierre [Thu, 5 Sep 2013 20:38:06 +0000 (16:38 -0400)]
Update docs

12 years agorepo: Rename ostree_repo_check to ostree_repo_open
Jasper St. Pierre [Thu, 5 Sep 2013 17:41:46 +0000 (13:41 -0400)]
repo: Rename ostree_repo_check to ostree_repo_open

As it more clearly describes what the function does: load the
repo from disk and initialize it.

At the same time, add a cancellable parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=707582

12 years agorepo: Move the 'init' builtin command to a public API, ostree_repo_create
Jasper St. Pierre [Thu, 5 Sep 2013 04:14:30 +0000 (00:14 -0400)]
repo: Move the 'init' builtin command to a public API, ostree_repo_create

This continues the goal of making more of ostree accessible by API,
rather than forking out to subprocesses.

https://bugzilla.gnome.org/show_bug.cgi?id=707582

12 years agorepo: Use constructed, not constructor
Jasper St. Pierre [Thu, 5 Sep 2013 04:05:04 +0000 (00:05 -0400)]
repo: Use constructed, not constructor

It's simpler to do this after the object is constructed, rather
than in the middle of construction.

https://bugzilla.gnome.org/show_bug.cgi?id=707582

12 years agoUpdate .gitignore
Jasper St. Pierre [Thu, 5 Sep 2013 04:21:01 +0000 (00:21 -0400)]
Update .gitignore

12 years agomain: Call setlocale()
Colin Walters [Wed, 4 Sep 2013 20:44:54 +0000 (16:44 -0400)]
main: Call setlocale()

While we're not translating anything right now, we should still
setlocale() so that our output is formatted as command line users will
expect.

12 years agocore: Delete unused prototype
Colin Walters [Wed, 4 Sep 2013 12:22:13 +0000 (08:22 -0400)]
core: Delete unused prototype

12 years agocore: Delete unused ostree_create_temp_dir() API
Colin Walters [Wed, 4 Sep 2013 12:18:45 +0000 (08:18 -0400)]
core: Delete unused ostree_create_temp_dir() API

Nothing was using it.  Poof.  Gone!

12 years agolibostree: Move file creation APIs out of core, into checkout.c
Colin Walters [Wed, 4 Sep 2013 12:17:42 +0000 (08:17 -0400)]
libostree: Move file creation APIs out of core, into checkout.c

Since this was the only user, let's not have generic code to go from
OSTree representation -> filesystem here.  It should live in checkout.

12 years agocore: Remove unused prototypes
Colin Walters [Wed, 4 Sep 2013 11:54:32 +0000 (07:54 -0400)]
core: Remove unused prototypes

12 years agocore: Make a helper function private
Colin Walters [Wed, 4 Sep 2013 11:53:02 +0000 (07:53 -0400)]
core: Make a helper function private

Nothing was using this, so make it private.

12 years agocore: Make ostree_write_variant_with_size() private
Colin Walters [Wed, 4 Sep 2013 11:49:41 +0000 (07:49 -0400)]
core: Make ostree_write_variant_with_size() private

More work making the file formats and utilities private.

12 years agolibostree: Make the format of file objects private
Colin Walters [Tue, 3 Sep 2013 22:42:02 +0000 (18:42 -0400)]
libostree: Make the format of file objects private

It's now isolated almost entirely to ostree-core.c, except
ostree-repo.c needs to know how to create archive-z2 file headers.  So
give it a private API for that.

12 years agorepo: Drop ostree_repo_load_variant_c API
Colin Walters [Tue, 3 Sep 2013 22:23:11 +0000 (18:23 -0400)]
repo: Drop ostree_repo_load_variant_c API

Originally we had this to avoid forcing callers to malloc() if they
had a csum, but nowadays we have in-place conversion APIs that are
fast enough.

12 years agorepo: Only apply setuid/xattrs after checksum validation
Colin Walters [Thu, 29 Aug 2013 23:26:00 +0000 (19:26 -0400)]
repo: Only apply setuid/xattrs after checksum validation

See the new comment in the source; basically if we're fetching content
over http, then someone with the capability to MITM the network could
create a transient setuid binary on disk with arbitrary content.  If
they also had a process running on the system (such as an application)
it could be escalated to root.

https://bugzilla.gnome.org/show_bug.cgi?id=707139

12 years agolibostree: Change synchronous fetching API to return a stream
Colin Walters [Sat, 31 Aug 2013 15:22:55 +0000 (11:22 -0400)]
libostree: Change synchronous fetching API to return a stream

There's not a good reason to write small things such as repo/config to
the filesystem, only to read them back in again.  Change the
non-partial API to just return a stream, then read it into a memory
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=707157

12 years agofetcher: Only open files when we are ready to write to them
Colin Walters [Sat, 31 Aug 2013 14:51:14 +0000 (10:51 -0400)]
fetcher: Only open files when we are ready to write to them

Otherwise we quickly run out of file descriptors when doing large
requests.

https://bugzilla.gnome.org/show_bug.cgi?id=707157

12 years agofetcher: Clean up code to avoid intermediate files
Colin Walters [Fri, 30 Aug 2013 23:29:04 +0000 (19:29 -0400)]
fetcher: Clean up code to avoid intermediate files

I think originally we had the .part/.done separation because we were
trying to support partial downloads of files like repo/config and
repo/refs.

But now that the http server configuration won't give us partial
results, we don't need to support caching those files between runs.

And thus, there's no reason to have the .part/.done and do the dance
with renaming them.

When fetching objects/ and other things that use _with_async, we
continue to use _append_to(), and if the returned range tells us we
have all the bytes, then we hand the full file over to the caller.

Don't attempt to shortcut in the case where the last run told us we
already have the object; the object fetcher code will not make a
request.

While we're here, also clean up use of GError and consistently use the
cancellable from the pending.

https://bugzilla.gnome.org/show_bug.cgi?id=707157

12 years agoprepare-root: Fix ostree= kernel argument at end
Colin Walters [Sun, 1 Sep 2013 08:16:52 +0000 (04:16 -0400)]
prepare-root: Fix ostree= kernel argument at end

Extracting the code for parse_ostree_cmdline() and running it on some
test input (on RHEL6.4 glibc), I can reproduce the odd behavior from
getline() where it apparently returns the size of the default malloc
buffer in the size output, and some non-zero value.

This behavior would be OK except that it breaks the logic for
stripping off the trailing newline, which in turn breaks booting
because we return "ostree=foo\n".

This has worked so far in gnome-ostree because syslinux apparently
injects initrd=/path/to/initrd as a final kernel argment.

Anyways, we don't handle NUL characters here in /proc/cmdline, so
let's just call strlen () to be safe.

https://bugzilla.gnome.org/show_bug.cgi?id=707192

12 years agolibostree: Make introspectable again
Jasper St. Pierre [Sun, 1 Sep 2013 15:17:38 +0000 (11:17 -0400)]
libostree: Make introspectable again

At some point, the variable name for the headers changed and the
introspection build line forgot to be updated.

https://bugzilla.gnome.org/show_bug.cgi?id=707228

12 years agotests: Drop kernel modules from checksums
Colin Walters [Fri, 30 Aug 2013 22:12:31 +0000 (18:12 -0400)]
tests: Drop kernel modules from checksums

We can actually share these across different kernels.  Thanks to
Tobias Hunger <tobias.hunger@gmail.com> for pointing this out.

12 years agoadmin: Error out if we see malformed or mismatched checksums for /boot
Colin Walters [Fri, 30 Aug 2013 22:10:35 +0000 (18:10 -0400)]
admin: Error out if we see malformed or mismatched checksums for /boot

The kernel/initramfs both need to end in -SHA256 and match.

12 years agorepo: Use non-deprecated API with sufficiently new libarchive
Colin Walters [Fri, 30 Aug 2013 08:50:29 +0000 (10:50 +0200)]
repo: Use non-deprecated API with sufficiently new libarchive

Based on a patch Tobias Hunger <tobias.hunger@gmail.com>

12 years agoFix warning about format string not being a string literal
Tobias Hunger [Fri, 30 Aug 2013 08:34:55 +0000 (10:34 +0200)]
Fix warning about format string not being a string literal

12 years agoFix warnings about unused variables
Tobias Hunger [Fri, 30 Aug 2013 08:32:37 +0000 (10:32 +0200)]
Fix warnings about unused variables

12 years agogitignore: Add ostree-prepare-root and ostree-remount binaries
Tobias Hunger [Thu, 29 Aug 2013 22:56:09 +0000 (00:56 +0200)]
gitignore: Add ostree-prepare-root and ostree-remount binaries

12 years agoostree: Support for using EDITOR to fill commit subject/body
Stef Walter [Thu, 29 Aug 2013 15:23:20 +0000 (17:23 +0200)]
ostree: Support for using EDITOR to fill commit subject/body

Behave similar to git when 'ostree commit' is run without
a --subject or --body. Bring up an editor. The first line becomes
the subject and following lines become the --body after an optional
blank line.

Use similar logic to git in determining EDITOR

https://bugzilla.gnome.org/show_bug.cgi?id=707063

12 years agoostree: Fix bug printing out commit body
Stef Walter [Thu, 29 Aug 2013 16:14:28 +0000 (18:14 +0200)]
ostree: Fix bug printing out commit body

Body was printed out repeated and mangled due to bad printf format string.

https://bugzilla.gnome.org/show_bug.cgi?id=707067

12 years agopull: Clean up synchronous fetching code
Colin Walters [Wed, 28 Aug 2013 19:29:50 +0000 (15:29 -0400)]
pull: Clean up synchronous fetching code

Fold in fetch_uri to fetch_uri_utf8(), and rename the latter to
include _sync as a suffix, since it's synchronous.

Improve the status line to show when we're fetching a synchronous URI;
previously we just showed "Scanning metadata".

https://bugzilla.gnome.org/show_bug.cgi?id=707023

12 years agomain: Support passing bare directory names to commit
Colin Walters [Wed, 28 Aug 2013 21:32:21 +0000 (17:32 -0400)]
main: Support passing bare directory names to commit

It segfaulted before if you passed non-options, and a single directory
name is probably what people want.

12 years agopull: Add support for resuming downloads via range requests
Jeremy Whiting [Mon, 26 Aug 2013 20:59:55 +0000 (14:59 -0600)]
pull: Add support for resuming downloads via range requests

Use a consistent temporary filename to download uri's.
Check for downloaded files before fetching from uri.
Download to hash.part file, then copy/move to hash.done when complete.
Add argument support to setup_fake_remote_repo1 function.
Add test for pull resume.
To implement this, pass --force-range-requests into the trivial-httpd,
which will only serve half of the objects to clients at a time.

https://bugzilla.gnome.org/show_bug.cgi?id=706344

12 years agotest: Improve pull corruption test
Jeremy Whiting [Tue, 27 Aug 2013 22:01:43 +0000 (16:01 -0600)]
test: Improve pull corruption test

To verify pull with a second repo works.

12 years agobuild: Add a note that ostree only supports InstalledTests
Colin Walters [Tue, 27 Aug 2013 23:34:58 +0000 (19:34 -0400)]
build: Add a note that ostree only supports InstalledTests

12 years agorepo: Clean up tmpdir also on transaction abort
Colin Walters [Tue, 27 Aug 2013 15:32:26 +0000 (11:32 -0400)]
repo: Clean up tmpdir also on transaction abort

Pull the cleanup code to a helper function, and ensure we delete
leftover temporary files also when aborting a transaction.  Mainly
this will happen if a local 'ostree commit' fails.

While we're here, also change it to use gs_shutil_rm_rf() which also
handles directories, should we start using those.

Reviewed-by: Jeremy Whiting <jpwhiting@kde.org>
12 years agorepo: Clean up temporaries after a transaction completes
Jeremy Whiting [Mon, 26 Aug 2013 21:44:06 +0000 (15:44 -0600)]
repo: Clean up temporaries after a transaction completes

Prevously, we were just leaving temporary files there forever if
a transaction was interrupted.

https://bugzilla.gnome.org/show_bug.cgi?id=706344

12 years agotrivial-httpd: Add missing include for shutdown() on eglibc
Colin Walters [Mon, 26 Aug 2013 21:57:43 +0000 (17:57 -0400)]
trivial-httpd: Add missing include for shutdown() on eglibc

12 years agotrivial-httpd: Close the socket when sending partial files
Jeremy Whiting [Mon, 26 Aug 2013 20:52:43 +0000 (14:52 -0600)]
trivial-httpd: Close the socket when sending partial files

This will force the client to re-request them, which will be used to
test interrupted "ostree pull" requests.

https://bugzilla.gnome.org/show_bug.cgi?id=706344

12 years agoRelease 2013.6
Colin Walters [Mon, 26 Aug 2013 03:34:51 +0000 (23:34 -0400)]
Release 2013.6

12 years agodoc/adapting-existing: Describe /lib/passwd
Colin Walters [Sun, 25 Aug 2013 20:12:14 +0000 (16:12 -0400)]
doc/adapting-existing: Describe /lib/passwd

12 years agomain: Code cleanup by passing OstreeRepo * directly to builtins
Colin Walters [Sun, 25 Aug 2013 19:11:05 +0000 (15:11 -0400)]
main: Code cleanup by passing OstreeRepo * directly to builtins

It turns out every builtin (with one special exception) that takes a
repo argument did the same thing; let's just centralize it.  The
special exception was "ostree init --repo=foo" where foo is expected
to *not* actually be a repo.  In that case, simply skip the
ostree_repo_check() invocation.

https://bugzilla.gnome.org/show_bug.cgi?id=706762

12 years agolibostree: Improve commit filter API
Colin Walters [Sat, 17 Aug 2013 18:19:37 +0000 (14:19 -0400)]
libostree: Improve commit filter API

Make the structure private, and document the flags.

https://bugzilla.gnome.org/show_bug.cgi?id=706214

12 years agopull: Drop obsoleted "related objects" API
Colin Walters [Mon, 19 Aug 2013 23:13:53 +0000 (19:13 -0400)]
pull: Drop obsoleted "related objects" API

We removed support for writing "related objects" from ostree commits
in ostree git c9b61cbfee5d3cd0433ef14eac9ba9d1b24a0e38 because it just
didn't work out as an idea.  This also removes the API and code from
"ostree pull".

Note there was no test suite coverage.

https://bugzilla.gnome.org/show_bug.cgi?id=706342

12 years agorepo: Fix object storage size API to be 64 bit
Colin Walters [Sun, 18 Aug 2013 11:56:20 +0000 (07:56 -0400)]
repo: Fix object storage size API to be 64 bit

This fixes a pointer size warning on 32-bit builds.

https://bugzilla.gnome.org/show_bug.cgi?id=706235

12 years agodoc: Minor tweaks
Colin Walters [Sun, 25 Aug 2013 14:32:40 +0000 (10:32 -0400)]
doc: Minor tweaks

12 years agodoc/adapting-existing: Elaborate a bit more on FS layout and links
Colin Walters [Sun, 25 Aug 2013 14:23:19 +0000 (10:23 -0400)]
doc/adapting-existing: Elaborate a bit more on FS layout and links

12 years agodoc/adapting-existing: A bit more elaboration and a typo fix
Colin Walters [Sat, 24 Aug 2013 23:18:57 +0000 (19:18 -0400)]
doc/adapting-existing: A bit more elaboration and a typo fix

12 years agodoc: Add some docs about adapting existing package managers
Colin Walters [Sat, 24 Aug 2013 15:35:42 +0000 (11:35 -0400)]
doc: Add some docs about adapting existing package managers

12 years agopull: Update comment to better reflect current reality
Colin Walters [Fri, 23 Aug 2013 21:31:24 +0000 (17:31 -0400)]
pull: Update comment to better reflect current reality

12 years agodoc/repo: Describe object types
Colin Walters [Fri, 23 Aug 2013 21:21:31 +0000 (17:21 -0400)]
doc/repo: Describe object types

12 years agodoc/overview: Add a note about the GPL
Colin Walters [Fri, 23 Aug 2013 21:21:19 +0000 (17:21 -0400)]
doc/overview: Add a note about the GPL

12 years agodoc: Add a section about how atomic upgrades work
Colin Walters [Thu, 22 Aug 2013 23:14:23 +0000 (19:14 -0400)]
doc: Add a section about how atomic upgrades work

Migrating some content from
https://live.gnome.org/OSTree/DeploymentModel2

12 years agotrivial-httpd: Handle the autoexit case when the docroot is a symlink
Vivek Dasmohapatra [Thu, 22 Aug 2013 18:44:29 +0000 (19:44 +0100)]
trivial-httpd: Handle the autoexit case when the docroot is a symlink

12 years agotrivial-httpd: Close stdout & stdin so $() can capture output when daemonized
Vivek Dasmohapatra [Thu, 22 Aug 2013 18:43:44 +0000 (19:43 +0100)]
trivial-httpd: Close stdout & stdin so $() can capture output when daemonized

Will be used by tests.

12 years agotrivial-httpd: Handle -p - as meaning write-port-to-stdout
Vivek Dasmohapatra [Thu, 22 Aug 2013 17:28:14 +0000 (18:28 +0100)]
trivial-httpd: Handle -p - as meaning write-port-to-stdout

This is convenient to use from tests.

12 years agofetcher: Return NOT_FOUND when the HTTP code is 410 or 404
Vivek Dasmohapatra [Mon, 19 Aug 2013 17:13:44 +0000 (18:13 +0100)]
fetcher: Return NOT_FOUND when the HTTP code is 410 or 404

This will be used by the pull code to download optional data.